package com.atguigu.util.method_son;

import com.atguigu.util.method_fa.Product;

/**
 * @author caesar
 * @date 2025/7/7
 * @Description:
 * @apiNote
 */
public class Electronics extends Product {
    private int warrantyPeriod; // 保修期（月）

    public Electronics() {
    }

    public Electronics(String productId, String name, double price, int warrantyPeriod) {
        super(productId, name, price);
        this.warrantyPeriod = warrantyPeriod;
    }

    public int getWarrantyPeriod() {
        return warrantyPeriod;
    }

    public void setWarrantyPeriod(int warrantyPeriod) {
        this.warrantyPeriod = warrantyPeriod;
    }

    @Override
    public String toString() {
        return super.toString() + ", 保修期: " + warrantyPeriod + " 个月";
    }
}
